package com.sl.ms.carriage.handler;

import com.sl.ms.base.api.common.AreaFeign;
import com.sl.ms.carriage.domain.constant.CarriageConstant;
import com.sl.ms.carriage.domain.dto.WaybillDTO;
import com.sl.ms.carriage.entity.CarriageEntity;
import com.sl.ms.carriage.service.CarriageService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * description:
 *
 * @Author youhongwei
 * @Create 2025/6/23 21:08
 * @Version 1.0
 */
@Order(400)
@Component
public class TransProvinceChainHandler extends AbsCarriageChainHandler{

    @Resource
    private CarriageService carriageService;


    @Override
    public CarriageEntity doHandler(WaybillDTO waybillDTO) {

        CarriageEntity carriageEntity = this.carriageService.findByTemplateType(CarriageConstant.TRANS_PROVINCE);

        if(carriageEntity != null){
            return carriageEntity;
        }

        return doNextHandler(waybillDTO);
    }
}
